﻿namespace EyeOpen.Data
{
    using System;
    using System.Collections.Generic;
    using EyeOpen.Queries;

    public interface IDataContext : IDisposable
    {
        IEnumerable<TResult> GetByQuery<TSource, TResult>(IQuery<TSource, TResult> query);

        IEnumerable<TResult> GetByQuery<TSource, TResult>(IQuery<TSource, TResult> query, int pageIndex, int pageSize);

        void BeginTransaction();

        void Commit();

        void Rollback();

        void ExecuteInTransaction(Action action);

        void SaveChanges();
    }
}